home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Extravaganza - Disc 4
/
Shareware Extravaganza - Over 25,000 Programs (The Ultimate Shareware Company)(Disc 4 of 4)(1993).iso
/
cad
/
edittxt.zip
/
EDITTXT.LSP
< prev
Wrap
Text File
|
1990-12-27
|
2KB
|
92 lines
(defun c:edittxt ()
(setq pick (entsel "\nPICK TEXT: "))
(if (= "TEXT" (cdr (assoc 0 (setq e (entget (car pick))))))
(progn
(setq otext (cdr (setq as (assoc 1 e))))
(princ (strcat "\n>" otext))
(princ "\n>_")
(setq edit "")
(setq pos 1)
(if (= (car (setq in (grread))) 2) (setq ch (cadr in)) (setq ch 0))
(while (/= ch 13)
(cond
((= ch 8)
(if (> pos 1)
(progn
(princ (strcat (chr 8) (chr 8) "_"))
(setq pos (1- pos))
(setq edit (substr edit 1 (1- pos)))
)
)
)
((and (> ch 31) (< ch 127))
(if (< pos 80)
(progn
(setq edit (strcat edit (chr ch)))
(setq pos (1+ pos))
(princ (strcat (chr 8) (chr ch) "_"))
)
)
)
)
(if (= (car (setq in (grread))) 2) (setq ch (cadr in)) (setq ch 0))
)
(while (> (strlen edit) 0)
(princ (chr 8))
(setq ntxt "")
(setq i 1)
(setq ch " ")
(while (and (<= i (strlen edit)) (/= ch "["))
(setq ch (substr edit i 1))
(cond
((= ch " ") (if (> i (strlen otext))
(setq ntxt (strcat ntxt " "))
(setq ntxt (strcat ntxt (substr otext i 1)))
))
((= ch "^") (setq ntxt (strcat ntxt " ")))
((= ch "[") (setq ntxt (strcat ntxt (substr edit (1+ i)))))
((/= ch "\\") (setq ntxt (strcat ntxt ch)))
)
(if (/= ch "[") (setq i (1+ i)))
)
(if (<= i (strlen otext))
(setq ntxt (strcat ntxt (substr otext i))))
(setq otext ntxt)
(princ (strcat "\n>" otext))
(princ "\n>_")
(setq edit "")
(setq pos 1)
(if (= (car (setq in (grread))) 2) (setq ch (cadr in)) (setq ch 0))
(while (/= ch 13)
(cond
((= ch 8)
(if (> pos 1)
(progn
(princ (strcat (chr 8) (chr 8) "_"))
(setq pos (1- pos))
(setq edit (substr edit 1 (1- pos)))
)
)
)
((and (> ch 31) (< ch 127))
(if (< pos 80)
(progn
(setq edit (strcat edit (chr ch)))
(setq pos (1+ pos))
(princ (strcat (chr 8) (chr ch) "_"))
)
)
)
)
(if (= (car (setq in (grread))) 2) (setq ch (cadr in)) (setq ch 0))
)
)
(setq e (subst (cons 1 ntxt) as e))
(entmod e)
))
()
)
(edittxt)